package com.cgmnx.admin.service;

import com.cgmnx.admin.dao.condition.NoteCondition;
import com.cgmnx.admin.dao.entity.NoteEntity;
import com.cgmnx.admin.dao.mapper.NoteMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zippoy
 * 2018-04-23
 * @since 1.0.0
 */
@Service
public class NoteServiceImpl implements NoteService {

    @Resource
    private NoteMapper noteMapper;

    @Override
    public int count(NoteCondition condition) {
        return noteMapper.count(condition);
    }

    @Override
    public NoteEntity query(Integer id) {
        return noteMapper.queryById(id);
    }

    @Override
    public List<NoteEntity> queryPage(NoteCondition condition) {
        return noteMapper.queryPage(condition);
    }

    @Override
    public void save(NoteEntity convert) {
        noteMapper.save(convert);
    }

    @Override
    public void update(NoteEntity convert) {
        noteMapper.update(convert);
    }

    @Override
    public void updateAudit(Integer id, Integer newStatus, Integer oldStatus) {
        noteMapper.updateAudit(id, newStatus, oldStatus);
    }


}
